﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">

        //new
        /*
        function TestFun() {
            document.write("abc");
        }

        var ojb = new TestFun();
        */
        //this
        //window
        /*
        this.TestName = "aaa";

        function TestFun() {
            this.TestName = "bbb";
        }

        //TestFun(); window
        //new TestFun(); obj
        var obj = new TestFun();
        document.write(obj.TestName);
        */
//        var value = 99;
//        function Show(val) {
//            document.write(val);
        //        }

        this.TestName = "aaa";

        function TestFun() {
            this.TestName = "bbb";
        }

        //TestFun(); window
        //new TestFun(); obj
        var obj = new TestFun();

        with (obj) {
            TestName = "ccc";
        }
        document.write(obj.TestName);
    
    </script>
</head>
<body>
<input type="button" value="Test" onclick="Show(this.value);" />
</body>
</html>
